﻿using System.Reflection;
using Abp.AutoMapper;
using Abp.Modules;
using LpbPrj.Client.Patients.Mapper;
using LpbPrj.Client.Records.Mapper;
using LpbPrj.Client.Reports.Mapper;
using LpbPrj.Client.Results.Mapper;
using LpbPrj.Client.Users.Mapper;

namespace LpbPrj.Client
{
    [DependsOn(typeof(ClientCoreModule))]
    public class ClientApplicationModule : AbpModule
    {
        public override void Initialize()
        {
            IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly());

            //解析依赖，并进行映射规则创建
            Configuration.Modules.AbpAutoMapper().Configurators.Add(
                cfg =>
                {
                    PatientMapper.CreateMappings(cfg);
                    RecordMapper.CreateMappings(cfg);
                    ResultMapper.CreateMappings(cfg);
                    ReportMapper.CreateMappings(cfg);
                    UserMapper.CreateMappings(cfg);
                }
            );
        }
    }
}
